"use strict";
cc._RF.push(module, 'a9242h8mvxBCaE+BGt4FVEU', 'user_backWater_item');
// scripts/module/user_backWater_item.js

'use strict';

// Learn cc.Class:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
// Learn Attribute:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
// Learn life-cycle callbacks:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html

cc.Class({
    extends: cc.Component,

    properties: {
        labDate: cc.Label, //日期
        labMoney: cc.Label, //元宝
        labState: cc.Label, //房间类型
        _data: null

    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start: function start() {
        this.labMoney.string = LotteryUtils.moneytoServer(this._data.Rebate) + '元宝';
        this.labState.string = this._data.RoomName;
        var date = Utils.formateServiceDateStrToDate(this._data.Time);
        this.labDate.string = this.splitTwo(date.getFullYear()) + '-' + this.splitTwo(date.getMonth() + 1) + '-' + this.splitTwo(date.getDate());
    },


    splitTwo: function splitTwo(num) {
        return num.toString().length < 2 ? "0" + num.toString() : num.toString();
    },

    init: function init(data) {
        this._data = data;
        //cc.log('Water',this._data);
    }

    // update (dt) {},
});

cc._RF.pop();